#include <utils/date/month.h>


namespace AccountManagerUtils {

String Month::months_[13] = {
	"undefined",
	"january",
	"february",
	"march",
	"april",
	"may",
	"june",
	"july",
	"august",
	"september",
	"october",
	"november",
	"december"
};

String Month::Months_[13] = {
	"Undefined",
	"January",
	"February",
	"March",
	"April",
	"May",
	"June",
	"July",
	"August",
	"September",
	"October",
	"November",
	"December"
};

MonthIndex Month::month_index( const String& month ) {
	for ( int k = 1; k < 13; ++k ) {
		if ( month == months_[k] ) return (MonthIndex)k;
		if ( month == Months_[k] ) return (MonthIndex)k;
	}
	return UndefinedMonth;
}

const String& Month::month_name( MonthIndex month ) {
	return months_[(int)month];
}

const String& Month::month_name_uppercase( MonthIndex month ) {
	return Months_[(int)month];
}

} // namespace AccountManagerUtils

